##首先读取文件美国，日本，印度.txt
import json
def data_us():
    us_f=open('D:/美国.txt','r',encoding='utf-8')
    us_f=us_f.read()
    us_f=us_f.replace("jsonp_1629344292311_69436(",'')
    us_f=us_f[:-2:]
    # 将json 转python文件
    us_f_j=json.loads(us_f)
   #懒人网看层级
    us_f_j = us_f_j['data'][0]['trend']
  #获取确诊的三条数据
    us_data_x = us_f_j['list'][0]['data']
    print(type(us_data_x))

    return  us_data_x

def data_jp():
    jp_f=open('D:/日本.txt','r',encoding='utf-8')
    jp_f=jp_f.read()
    jp_f=jp_f.replace("jsonp_1629350871167_29498(",'')
    jp_f=jp_f[:-2:]

    jp_f_j = json.loads(jp_f)
    jp_f_j = jp_f_j['data'][0]['trend']
    jp_data_y = jp_f_j['list'][0]['data']
    return jp_data_y

def data_ld():
    ld_f=open('D:/印度.txt','r',encoding='utf-8')
    ld_f=ld_f.read()
    ld_f=ld_f.replace("jsonp_1629350745930_63180(",'')
    ld_f=ld_f[:-2:]
    #将json 转python文件
    ld_f_j=json.loads(ld_f)
    #懒人网看层级
    ld_f_j=ld_f_j['data'][0]['trend']
    #获取确诊的三条数据

    ld_data_z=ld_f_j['list'][0]['data']

    return ld_data_z

if __name__ == '__main__':
    print(data_ld())

